define(function(require, exports, module) {
    function bindDelFollow() {
        $('.js-del-follow').on('click', function() {
            if (!confirm('确定要取消关注吗？')) {
                return;
            }
            var userId = $(this).attr('userId');
            $.ajax({
                url: '/Ajax/User/delFollow',
                type: 'post',
                data: {userId: userId},
                dataType: 'json',
                success: function(d) {
                    if (d.error) {
                        alert(d.data);
                    } else {
                        window.location.reload();
                    }
                }
            });
        });
    }
    exports.init = function() {
        bindDelFollow();
    }
});